package Linaer_Search;

/**
 * @author wly
 * @version V1.0.0
 * @date 2023/1/21 9:54
 */
public class LinearSearch {
//    构造函数为私有
    private LinearSearch(){}

    public static int search(int[] data, int target){
        for (int i = 0; i < data.length; i++) {
            if (data[i] == target){
                return i;
            }
        }
        return -1;
    }
}
